package com.eboy.bohao;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {
	private EditText edtNumber = null;
	private Button btnBoHao = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        edtNumber = (EditText) findViewById(R.id.editText1);
        btnBoHao = (Button) findViewById(R.id.button1);
        
        btnBoHao.setOnClickListener(new btnBoHao1Click());
        
    }
    
    public class btnBoHao1Click implements OnClickListener {

    	@Override
    	public void onClick(View arg0) {
    		String Number = edtNumber.getText().toString();
    		Intent intent = new Intent();
    		intent.setAction("android.intent.action.CALL");
    		intent.setData(Uri.parse("tel:" + Number));
    		startActivity(intent);  		
    	}
    }
    
}
